package com.ruoyi.crop.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.crop.api.domain.SrcLogistics;
import com.ruoyi.crop.service.LogisticsService;
import com.ruoyi.crop.mapper.LogisticsMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 27490
* @description 针对表【src_logistics(物流记录表)】的数据库操作Service实现
* @createDate 2024-07-29 15:21:02
*/
@Service
public class LogisticsServiceImpl extends ServiceImpl<LogisticsMapper, SrcLogistics>
    implements LogisticsService {

    @Override
    public List<SrcLogistics> listAll(SrcLogistics srcLogistics) {
        List<SrcLogistics> srcLogisticsList = null;
        if(SecurityUtils.getUserId()==1){
            srcLogisticsList = baseMapper.listAll(srcLogistics);
        }else{
            srcLogisticsList = baseMapper.listAllByDriverId(srcLogistics,srcLogistics.getDriverId());
        }
        return srcLogisticsList;
    }

    @Override
    public void deleteById(Integer logisticsId) {
        baseMapper.delById(logisticsId);
    }


}




